<?php

require_once('../include/GeneralTop.php');
require('../include/class/db.php');

if (!$super_admin) {
	die('<div style="text-align:center">Permission denied...</div>');
}

$id = "-1";
if (isset($_GET['recordID'])) {
  $id = $_GET['recordID'];
}

$db = new db;
$sql = sprintf("SELECT * FROM member_info WHERE member_id = %s", GetSQLValueString($id, "int"));
$res = $db->query($sql);
$row = $db->fetch($res);

include('AdminPanel.php');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="50%"  border="0" align="center" cellpadding="5" cellspacing="0" class="table_border_grey" style="margin-top:10px;">
  <tr>
    <td width="35%">member id</td>
    <td width="65%"><?php echo $row['member_id']; ?></td>
  </tr>
  <tr>
    <td>登录名</td>
    <td><?php echo $row['member_login']; ?></td>
  </tr>
  <tr>
    <td>会员姓名</td>
    <td><?php echo $row['member_name']; ?></td>
  </tr>
  <tr>
    <td>性别</td>
    <td><?php echo getMemberSex($row['Sex']); ?></td>
  </tr>
  <tr>
    <td>身份证号</td>
    <td><?php echo $row['Identity_id']; ?></td>
  </tr>
  <tr>
    <td>固定电话</td>
    <td><?php echo $row['Phone_number1']; ?></td>
  </tr>
  <tr>
    <td>联系手机</td>
    <td><?php echo $row['Phone_number2']; ?></td>
  </tr>
  <tr>
    <td>邮件地址</td>
    <td><?php echo $row['Email_account']; ?></td>
  </tr>
  <tr>
    <td>地址</td>
    <td><?php echo $row['Address']; ?></td>
  </tr>
  <tr>
    <td>上海区县</td>
    <td><?php echo $row['Distict']; ?></td>
  </tr>
  <tr>
    <td>邮政编码</td>
    <td><?php echo $row['Zip']; ?></td>
  </tr>
  <tr>
    <td>职业类型</td>
    <td><?php echo $row['profession_type']; ?></td>
  </tr>
  <tr>
    <td>家中是否饲养宠物？</td>
    <td><?php echo getIfHavePet($row['Pet_YN']); ?></td>
  </tr>
  <tr>
    <td>饲养何种宠物？</td>
    <td><?php echo getPetType($row['Pet_type']); ?></td>
  </tr>
  <tr>
    <td>宠物品种</td>
    <td><?php echo $row['Pet_breed']; ?></td>
  </tr>
  <tr>
    <td>宠物总数</td>
    <td><?php echo $row['Pet_count']; ?></td>
  </tr>
  <tr>
    <td>成为会员时间</td>
    <td><?php echo NULL == $row['Member_startDate'] ? '&nbsp;' : $row['Member_startDate']; ?></td>
  </tr>
  <tr>
    <td>从付费起一年</td>
    <td><?php echo NULL == $row['Member_endDate'] ? '&nbsp;' : $row['Member_endDate']; ?></td>
  </tr>
  <tr>
    <td>会员状态</td>
    <td><?php echo getMemberStatus($row['Member_Status']); ?></td>
  </tr>
  <tr>
    <td>会员类型</td>
    <td><?php echo getMemberType($row['Member_type']); ?></td>
  </tr>
  <tr>
    <td>是否愿意成为付费会员</td>
    <td><?php echo getIfVolunteer($row['be_pay_member_YN']); ?></td>
  </tr>
  <tr>
    <td>是否愿意成为志愿者</td>
    <td><?php echo getIfVolunteer($row['Volunteer_YN']); ?></td>
  </tr>
  <?php
  $vol_type = explode(",", $row['Volunteer_Type']);
  $vol_type_text = '';
  if(in_array(1, $vol_type)) {
  	  $vol_type_text .= getVolunteerType(1).'<br>';
  }
  if(in_array(2, $vol_type)) {
  	  $vol_type_text .= getVolunteerType(2).'<br>';;
  }
  if(in_array(3, $vol_type)) {
  	  $vol_type_text .= getVolunteerType(3).'<br>';;
  }
  if(in_array(4, $vol_type)) {
  	  $vol_type_text .= getVolunteerType(4).'<br>';;
  }
  if(in_array(5, $vol_type)) {
  	  $vol_type_text .= getVolunteerType(5).'<br>';;
  }
  if(in_array(6, $vol_type)) {
  	  $vol_type_text .= getVolunteerType(6);
  }
  ?>     
  <tr>
    <td>志愿者类型</td>
    <td><?php echo $vol_type_text; ?></td>
  </tr>
  <tr>
    <td>其它志愿者</td>
    <td><?php echo NULL == $row['Other_Volunteer'] ? '&nbsp;' : $row['Other_Volunteer']; ?></td>
  </tr>
  <tr>
    <td>外语能力</td>
    <td><?php echo $row['foreign_language']; ?></td>
  </tr>
  <tr>
    <td>如果可提供寄养，是否可免费寄养</td>
    <td><?php echo getIfFreeFoster($row['foster_fee_YN']); ?></td>
  </tr>
  <tr>
    <td>可寄养何种宠物？</td>
    <td><?php echo NULL == $row['foster_type'] ? '&nbsp;' : getPetType($row['foster_type']); ?></td>
  </tr>
  <tr>
    <td>如果要有偿寄养，收费是多少？</td>
    <td><?php echo NULL == $$row['foster_fee_amount'] ? '&nbsp;' : $row['foster_fee_amount']; ?></td>
  </tr>
  <tr>
    <td>兴趣/专长</td>
    <td><?php echo nl2br($row['interest_skills']); ?></td>
  </tr>
  <tr>
    <td>工作/义工/动物方面的经验</td>
    <td><?php echo nl2br($row['Experience']); ?></td>
  </tr>
  <tr>
    <td>管理员备忘1</td>
    <td><?php echo nl2br($row['memo1']); ?></td>
  </tr>
  <tr>
    <td>管理员备忘2</td>
    <td><?php echo nl2br($row['memo2']); ?></td>
  </tr>
  <tr>
  	<td>&nbsp;</td>
    <td><input type="button" id="button" onclick="javascript:history.go(-1);" value="<?php echo TEXT_BACK?>"></td>
  </tr>
</table>

</body>
</html>